1. Field of the Invention
The present invention relates to a program control circuit for use in a program controlled apparatus such as a microcomputer.
2. Description of Related Art
The advancement of integrated circuit technology has made it possible to assemble a considerably complicated logic circuit in a single chip of an integrated circuit. Such an integrated circuit can be exemplified by a single chip microcomputer, which has in turn become very complicated and diversified because of the complication of logic circuits which can be realized in an integrated circuit chip.
On the other hand, microcomputers are adapted to execute programs read from an internal memory or an external memory. In such a program controlled computer, how short and how clean a program is described is very significant to the high speed processing of data.
One typical example of an operation which requires a short and clean program is a numerical data processing, which requires a solution having a high degree of precision. For the purpose of elevating the precision of a solution, it is an ordinary practice to repeatedly execute the same processing. In this case, if the same program to be repeatedly executed is continuously described at the times corresponding to the number of repetitions, a short and simple program cannot be obtained. At present, therefore, there has been actually widely used such a method as to combine a processing program to be repeated and a conditional jump instruction so as to shorten a program to be prepared.
For example, the number of repetitions "N" of an operation program to be repeatedly executed is set in a register, and the operation program is repeatedly executed while decrementing the value held in the register by "1" after each one execution of the operation program. Then, when the value held in the register becomes "0", the repeated execution of the operation program is completed, and the next processing will be executed.
In the above mentioned repeated program execution, however, each time the operation program to be repeatedly executed is executed, not only the value held in the register must be decremented, but also, a discrimination must be made as to whether or not the value of the decremented register fulfills a given condition. This is done so that a determination is made on the basis of the discrimination as to whether the operation should be returned to the operation program to be repeatedly executed or whether it should go to the next program away from the operation program to be repeatedly executed. For discrimination on the content of the register, a logic circuit for discrimination should additionally be provided. Further, an instruction for executing the discrimination is required, and if the instruction is described in a program as one independent instruction, such a discrimination instruction must be executed the same number of times as the repetition number required for a repeated operation. Therefore, the larger the repetition number of the operation becomes, it follows that the time of the executions of the discrimination instruction increases, so that a total operation time of a program will inevitably become lengthy. In addition, if a repeated operation program contains therein another repeated operation subprogram, the time of the executions of discrimination instructions increases further, so that the number of program steps and a necessary processing time will become very large.